package com.lhl.biz.template.server.repository;

import com.lhl.biz.template.api.shared.domain.dto.TempDTO;
import com.lhl.biz.template.api.shared.domain.entity.Template;
import com.lhl.fw.db.repository.BaseJpaRepository;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.util.List;
import java.util.Optional;

/**
 * @className: TemplateRepository
 * @description: TODO 类描述
 * @author: king
 * @date: 2020-06-17 13:25
 **/
@Repository
public interface TemplateRepository extends BaseJpaRepository<Template, String> {

    Optional<List<Template>> findByBirthdayIsGreaterThanEqual(LocalDate birthday);

    /**
     * @param name:
     * @Description: JPAd动态字段投影查询
     * @Author: king
     * @Date: 2020-06-17 13:26
     * @return: java.util.Optional<com.lhl.biz.template.api.shared.domain.dto.TempDTO>
     **/
    Optional<TempDTO> findByName(String name);

}
